package service

import (
	"context"
	"mall-portalv2/internal/model"
)

func (s *Service) QueryViewCouponDetail(ctx context.Context, MemberId int64, Type int) ([]model.ViewCouponDetail, error) {
	var (
		result []model.ViewCouponDetail
		err    error
	)
	if Type == 1 {
		result, err = s.dao.QueryViewCouponDetail(ctx, MemberId)
		if err != nil {
			return nil, err
		}
	} else {
		result, err = s.dao.QueryViewCouponDetail(ctx, MemberId)
		if err != nil {
			return nil, err
		}
	}

	return result, err
}
